import request from "@/utils/request";

//创建摄像头接口
export function create_camera(data) {
  return request({
    url: `/ydyz/create_camera.php`,
    method: "post",
    data: data,
  });
}

//查询摄像头接口
export function query_camera(page, pageSize) {
  return request({
    url: `/ydyz/query_camera.php?page=${page}&limit=${pageSize}`,
    method: "get",
  });
}

//删除摄像头
export function delete_camera(id) {
  return request({
    url: `/ydyz/delete_camera.php?id=${id}`,
    method: "DELETE",
  });
}

//修改摄像头信息
export function update_camera(data) {
  return request({
    url: `/ydyz/update_camera.php`,
    method: "post",
    data: data,
  });
}

//这个是根据设备和时间范围查询的温度数据

export function handleScreening(page, pageSize, deviceId, begin, end) {
  return request({
    url: `ydyz/query_alarm.php?page=${page}&limit=${pageSize}&device_id=${deviceId}&begin=${begin}&end=${end}`,
    method: "get",
  });
}

//给当前设备拍照
export function create_action(data) {
  return request({
    url: `/ydyz/create_action.php`,
    method: "post",
    data: data,
  });
}
